<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <ul>
        <li>111</li>
        <li>222</li>
        <li>333</li>
        <li>444</li>
        <li>555</li>
    </ul>
    <script>
        //子节点：parentNode.childNodes    parentNode.children
    
        var ul = document.querySelector('ul');
        console.log(ul.children);
        

        //获取第一个子节点：parentNode.children[0]
        //获取最后一个子节点:parentNode.children[parentNode.children.length - 1]
        console.log(ul.children[0]);
        console.log(ul.children[ul.children.length - 1]);

    </script>
</body>
</html>